package ru.rchervot.sanasar.client.event;

import ru.rchervot.sanasar.client.place.Place;

import com.google.gwt.event.shared.GwtEvent;

public class EventPlaceChangeCompanies extends GwtEvent<HandlerPlaceChangeCompanies> {

	public static GwtEvent.Type<HandlerPlaceChangeCompanies> TYPE = new GwtEvent.Type<HandlerPlaceChangeCompanies>();
	
	private final Place place;
	
	public EventPlaceChangeCompanies(Place place) {
		this.place = place;
	}
	
	@Override
	protected void dispatch(HandlerPlaceChangeCompanies handler) {
		handler.onPlaceChange(this);
		
	}

	@Override
	public GwtEvent.Type<HandlerPlaceChangeCompanies> getAssociatedType() {
		return TYPE;
	}

	public static Type<HandlerPlaceChangeCompanies> getType() {
		if (TYPE == null) {
			TYPE = new Type<HandlerPlaceChangeCompanies>();
		}
		return TYPE;
	}
	
	public Place getPlace() {
		return place;
	}
}
